Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Upgrade to the latest everything #1168

Merged
merged 7 commits into from
Aug 27, 2024

Conversation

shankari
Copy link
Contributor

This fixes e-mission/e-mission-docs#1079
We are now at the first stage, where we are upgrading the base platform.
We have not yet made the code changes corresponding to the new API upgrade.

This is consistent with
e-mission/e-mission-docs#1079 (comment)
and may fix the errors in the CI/CD for the android SDK installation script

Testing done:
with the other changes in this PR, `npx cordova build` succeeded
This includes:
- cordova-android
- cordova-ios
- core plugins (inapp-browser)
- cordova CLI
- nvm, node, npm
- cocoapods
- gradle

This is consistent with
e-mission/e-mission-docs#1079 (comment)
to look through the changes in the cordova codebase
While investigating the issues with SSL errors, I discovered that cordova
doesn't use the system gradle, but configures `build.gradle` so that the
correct version of gradle is downloaded and installed on the first run.

This means that we don't need to install gradle manually, which in turn, means
that we don't need to install sdkman so that we install the pinned version of
gradle.

Yay for simplifying code and removing dependencies!
e-mission/e-mission-docs#1079 (comment)
We had a pinned npm version, but we didn't actually use it,
using the default version in node instead. As long as we have
a reasonbly recent version of node, that seems like it will work.
It is still pinned (just pinned implicitly by the node pin), and we don't
actually use the pinned version now anyway.

Yay for simplicity and not keeping bitrotted code around...
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (maint_upgrade_2024@adb7cf2). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                  @@
##             maint_upgrade_2024    #1168   +/-   ##
=====================================================
  Coverage                      ?   29.98%           
=====================================================
  Files                         ?      118           
  Lines                         ?     5190           
  Branches                      ?     1165           
=====================================================
  Hits                          ?     1556           
  Misses                        ?     3630           
  Partials                      ?        4           
Flag Coverage Δ
unit 29.98% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@shankari
Copy link
Contributor Author

So the good news is that the android SDK automated install works.
The bad news is that the iOS build fails with the same libarclite error.
Although it doesn't fail for me locally any more

Validate .../platforms/ios/build/Debug-iphonesimulator/emission.app (in target 'emission' from project 'emission')
    cd .../platforms/ios
    builtin-validationUtility .../platforms/ios/build/Debug-iphonesimulator/emission.app

Touch .../platforms/ios/build/Debug-iphonesimulator/emission.app (in target 'emission' from project 'emission')
    cd .../native_code_upgrade/platforms/ios
    /usr/bin/touch -c .../platforms/ios/build/Debug-iphonesimulator/emission.app

** BUILD SUCCEEDED **

I am going to spend a time bounded effort on fixing this because the startup cost of getting back to this is so high.
But if I am not able to do so, I will revert the iOS changes and move on

@shankari
Copy link
Contributor Author

We are at the correct versions
Activating nvm
Using version 20.9.0
Now using node v20.9.0 (npm v10.1.0)
Adding cocoapods to the path
Verifying /Users/runner/Library/Android/sdk or /Users/runner/Library/Android/sdk is set
Ensuring that we use the most recent version of the command line tools
Configuring the repo for building native code
Copied config.cordovabuild.xml -> config.xml and package.cordovabuild.json -> package.json
cordova version
12.0.0 ([email protected])
ionic version
6.20.8
And appear to find all the right patches
Apply patch to [
  'node_modules/@shopify/flash-list/ios/RNFlashList.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj',
  'node_modules/react-native-gesture-handler/apple/RNGestureHandler.xcodeproj/project.pbxproj',
  'node_modules/react-native-safe-area-context/ios/RNSafeAreaContext.xcodeproj/project.pbxproj',
  'node_modules/react-native-screens/ios/RNScreens.xcodeproj/project.pbxproj',
  'node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj/project.pbxproj',
  'platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'platforms/ios/Pods/Pods.xcodeproj/project.pbxproj',
  'platforms/ios/emission.xcodeproj/project.pbxproj'
]
Done setting IPHONEOS_DEPLOYMENT_TARGET

Let's try to reproduce locally first from scratch.

@shankari
Copy link
Contributor Author

Ok, so this is reproducible.

I just did

$ rm -rf platforms/
$ rm -rf plugins/
$ rm -rf node_modules/
$ bash setup/setup_ios_native.sh
$ npx cordova build ios

and it failed

Trying to fix it locally...

@shankari
Copy link
Contributor Author

  1. Confirmed that just rebuilding (e.g. using npx cordova build ios again and again) does not work.
  2. Confirmed that installing android (bash setup/setup_android_native.sh) and then building does not work
  3. Confirmed that building both targets (npx cordova build) does not work

Now I am not sure what I did yesterday for it to work. The precipitating event that got it to work yesterday was that I upgraded the cordova CLI version (e-mission/e-mission-docs#1079 (comment)), but I am now at the correct cordova version and it doesn't seem to fix it.

This is why we have the CI/CD in the first place, so yay?!

But now let's try to debug it locally.

@shankari
Copy link
Contributor Author

The script works, but the build still fails. There does seem to be some overlap with discovering `cordova-plugin-ibeacon`. Not sure why this is not happening for the other plugins...
$ npx cordova build ios
Apply patch to [
  'node_modules/@shopify/flash-list/ios/RNFlashList.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj',
  'node_modules/react-native/template/ios/HelloWorld.xcodeproj/project.pbxproj',
  'node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj/project.pbxproj',
  'node_modules/react-native-safe-area-context/ios/RNSafeAreaContext.xcodeproj/project.pbxproj',
  'node_modules/react-native-screens/ios/RNScreens.xcodeproj/project.pbxproj',
  'node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj/project.pbxproj',
  'platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'platforms/ios/Pods/Pods.xcodeproj/project.pbxproj',
  'platforms/ios/emission.xcodeproj/project.pbxproj'
]
Done setting IPHONEOS_DEPLOYMENT_TARGET
/usr/bin/git
Downloading locales: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/bin/conf/translate_config.json not found, I will extract translate repo from translation_config.json.sample.
Already up to date.
cordova-custom-config: Skipping auto-restore of config file backup(s)
Discovered plugin "cordova-plugin-ibeacon". Adding it to the project
before patching, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 10.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 8.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 9.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

After patching, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

/Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'Bolts' from project 'Pods')
** BUILD FAILED **


The following build commands failed:
	Ld /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/Bolts/Bolts.framework/Bolts normal (in target 'Bolts' from project 'Pods')
Bingo! The `com.unarin.cordova.beacon` plugin is not in `package.json`, so it is an implicit package. It looks like we try to add it again, which seems to add the old deployment targets again (probably by calling `prepare`)
After patching, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

Plugin "com.unarin.cordova.beacon" already installed on android.
Plugin "com.unarin.cordova.beacon" already installed on ios.
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
List simulator targets
Select last emulator from list as default.
List simulator targets
No simulator found for ". Falling back to the default target.
Building for "iPhone 15 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro-Max, iPhone-15-Pro-Max).
Building project: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission.xcworkspace
        Configuration: Debug
        Platform: emulator
        Target: iPhone 15 Pro Max
before compile, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 10.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 8.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 9.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

So the potential fixes are:

  1. add com.unarin.cordova.beacon to package.json
  2. move the IPHONEOS_DEPLOYMENT_TARGET fix to before_compile
    or both!

I think we should at least do (2) because there might be other implicit packages in the future.
But I'm going to do (1) first locally to validate my hypothesis

@shankari
Copy link
Contributor Author

Adding the beacon plugins did not fix the issue
$ git diff package.cordovabuild.json
diff --git a/package.cordovabuild.json b/package.cordovabuild.json
index ff3812841..7305aeb19 100644
--- a/package.cordovabuild.json
+++ b/package.cordovabuild.json
@@ -98,7 +98,8 @@
       },
       "cordova-plugin-bluetooth-classic-serial-port": {},
       "cordova-custom-config": {},
-      "cordova-plugin-ibeacon": {}
+      "cordova-plugin-ibeacon": {},
+      "com.unarin.cordova.beacon": {}
     }
   },
   "dependencies": {
@@ -136,6 +137,7 @@
     "cordova-plugin-bluetooth-classic-serial-port": "git+https://github.com/louisg1337/cordova-plugin-bluetooth-classic-serial-port.git",
     "cordova-custom-config": "^5.1.1",
     "cordova-plugin-ibeacon": "git+https://github.com/louisg1337/cordova-plugin-ibeacon.git",
+    "com.unarin.cordova.beacon": "github:louisg1337/cordova-plugin-ibeacon",
     "core-js": "^2.5.7",
     "e-mission-common": "github:JGreenlee/e-mission-common#semver:0.5.4",
     "enketo-core": "^6.1.7",

Resulted in

^[[37mcordova-custom-config: Skipping auto-restore of config file backup(s)^[[39m
Discovered plugin "cordova-plugin-ibeacon". Adding it to the project
before patching, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 10.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 8.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 9.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

Plugin "com.unarin.cordova.beacon" already installed on android.
Plugin "com.unarin.cordova.beacon" already installed on ios.
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
List simulator targets
Select last emulator from list as default.
List simulator targets
No simulator found for ". Falling back to the default target.
Building for "iPhone 15 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro-Max, iPhone-15-Pro-Max).
Building project: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission.xcworkspace
        Configuration: Debug
        Platform: emulator
        Target: iPhone 15 Pro Max
before compile, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 10.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 8.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 9.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

Aha! If I look at the plugin list, I still don't see the ibeacon plugin

$ npx cordova plugin list
@havesource/cordova-plugin-push 4.0.0-dev.0 "Cordova Push Plugin"
com.unarin.cordova.beacon 3.8.1 "Proximity Beacon Plugin"
cordova-custom-config 5.1.1 "cordova-custom-config"
cordova-plugin-advanced-http 3.3.1 "Advanced HTTP plugin"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.14 "AppVersion"
cordova-plugin-badge-fix 0.8.10 "Badge"
cordova-plugin-bluetooth-classic-serial-port 0.9.13 "Bluetooth Classic Serial"
cordova-plugin-customurlscheme 5.0.2 "Custom URL scheme"
cordova-plugin-device 2.1.0 "Device"
cordova-plugin-em-datacollection 1.8.8 "DataCollection"
cordova-plugin-em-opcodeauth 1.7.2 "OPCodeAuth"
cordova-plugin-em-server-communication 1.2.6 "ServerComm"
cordova-plugin-em-serversync 1.3.2 "ServerSync"
cordova-plugin-em-settings 1.2.3 "ConnectionSettings"
cordova-plugin-em-unifiedlogger 1.3.6 "UnifiedLogger"
cordova-plugin-em-usercache 1.1.9 "UserCache"
cordova-plugin-file 8.0.0 "File"
cordova-plugin-inappbrowser 6.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification-12 0.1.4-fix-android-action "LocalNotification"
cordova-plugin-x-socialsharing 6.0.4 "SocialSharing"
es6-promise-plugin 4.2.2 "Promise"
phonegap-plugin-barcodescanner 8.1.1-dev "BarcodeScanner"

I bet this is because the plugin name (at least on installation) is actually com.unarin.cordova.beacon.
There seems to be a mismatch between what we call the beacon and what it calls itself.
Trying to fix that...

@shankari
Copy link
Contributor Author

That fixed the `Discovered plugin "cordova-plugin-ibeacon". Adding it to the project` and `Plugin "com.unarin.cordova.beacon" already installed on android.` issue, but did not fix the replacement
Downloading locales: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/bin/conf/translate_config.json not found, I will extract translate repo from translation_config.json.sample.
Already up to date.
^[[37mcordova-custom-config: Skipping auto-restore of config file backup(s)^[[39m
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
...
After patching, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
before compile, grep for IPHONEOS_DEPLOYMENT_TARGET:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 10.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 8.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 9.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

I still don't know how I ever got this to work on my local laptop, and I have now lost that setting, so I can't figure it out.

  • Fixing this anyway since it is the right thing to do
  • Changing to before_compile to move on

This ensures that we don't "discover" the plugin and try to install it
e-mission#1168 (comment)

Without this change:
```
Discovered plugin "cordova-plugin-ibeacon". Adding it to the project
Plugin "com.unarin.cordova.beacon" already installed on android.
Plugin "com.unarin.cordova.beacon" already installed on ios.
```

With this change: those logs don't show up
It was in `before_build` earlier, but that led to the changes from the script
being overridden before the actual compile started
e-mission/e-mission-docs#1079 (comment)
e-mission#1168 (comment)
e-mission#1168 (comment)
e-mission#1168 (comment)
e-mission#1168 (comment)

Testing done:

Before this change:

```
Done setting IPHONEOS_DEPLOYMENT_TARGET
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
```

After this change:

```
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
...
Done setting IPHONEOS_DEPLOYMENT_TARGET
...
Touch /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/emission.app (in target 'emission' from project 'emission')
    cd /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios
    /usr/bin/touch -c /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/emission.app

** BUILD SUCCEEDED **
```
@shankari
Copy link
Contributor Author

shankari commented Aug 27, 2024

`before_compile` worked!
Downloading locales: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/bin/conf/translate_config.json not found, I will extract translate repo from translation_config.json.sample.
Already up to date.
^[[37mcordova-custom-config: Skipping auto-restore of config file backup(s)^[[39m
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
config file AndroidManifest.xml requested for changes not found at /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/AndroidManifest.xml, ignoring
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
Apply patch to [
  'node_modules/@shopify/flash-list/ios/RNFlashList.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj',
  'node_modules/react-native/template/ios/HelloWorld.xcodeproj/project.pbxproj',
  'node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj/project.pbxproj',
  'node_modules/react-native-safe-area-context/ios/RNSafeAreaContext.xcodeproj/project.pbxproj',
  'node_modules/react-native-screens/ios/RNScreens.xcodeproj/project.pbxproj',
  'node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj/project.pbxproj',
  'platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'platforms/ios/Pods/Pods.xcodeproj/project.pbxproj',
  'platforms/ios/emission.xcodeproj/project.pbxproj'
]
Done setting IPHONEOS_DEPLOYMENT_TARGET
List simulator targets
Select last emulator from list as default.
List simulator targets
No simulator found for ". Falling back to the default target.
Building for "iPhone 15 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro-Max, iPhone-15-Pro-Max).
Building project: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission.xcworkspace
...
Touch /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/emission.app (in target 'emission' from project 'emission')
    cd /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios
    /usr/bin/touch -c /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/emission.app

** BUILD SUCCEEDED **

…T_TARGET`

Add additional logging to debug this more efficiently in the future
The additional logging is accessed with `--verbose`. While testing this, I
realized that `--verbose` would have been helpful in debugging this issue in
the first place - it makes is really clear that the `pod install` happens as
part of prepare before the compile. Still not sure how it worked locally before!

- No verbose:

```
cordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist
Apply patch to [
  'node_modules/@shopify/flash-list/ios/RNFlashList.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj',
  'node_modules/react-native/template/ios/HelloWorld.xcodeproj/project.pbxproj',
  'node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj/project.pbxproj',
  'node_modules/react-native-safe-area-context/ios/RNSafeAreaContext.xcodeproj/project.pbxproj',
  'node_modules/react-native-screens/ios/RNScreens.xcodeproj/project.pbxproj',
  'node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj/project.pbxproj',
  'platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'platforms/ios/Pods/Pods.xcodeproj/project.pbxproj',
  'platforms/ios/emission.xcodeproj/project.pbxproj'
]
Done setting IPHONEOS_DEPLOYMENT_TARGET
List simulator targets
Select last emulator from list as default.
List simulator targets
No simulator found for ". Falling back to the default target.
Building for "iPhone 15 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro-Max, iPhone-15-Pro-Max).
Building project: /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission.xcworkspace
	Configuration: Debug
	Platform: emulator
	Target: iPhone 15 Pro Max
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace emission.xcworkspace -scheme emission -configuration Debug -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 15 Pro Max" build SYMROOT=/Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build
```

- verbose

```
pods.json found in platforms/ios
Podfile found in platforms/ios
Wrote to Podfile.
Running `pod install` (to install plugins)
==== pod install start ====
==== pod install end ====
Updating resource files at platforms/ios
Prepared iOS project successfully

Executing script found in config.xml for hook "before_compile": hooks/before_compile/ios/ios_change_deployment.js
Context {
  hook: 'before_compile',
  opts: {
    platforms: [ 'ios' ],
    options: { verbose: true, argv: [] },
    verbose: true,
    silent: false,
    nohooks: [],
    searchpath: undefined,
    projectRoot: '/Users/kshankar/Desktop/data/e-mission/native_code_upgrade',
    cordova: { platforms: [Array], plugins: [Array], version: '12.0.1' },
    save: false,
    paths: [
      '/Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/www'
    ]
  },
  cmdLine: '/Users/kshankar/.nvm/versions/node/v20.9.0/bin/node /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/node_modules/.bin/cordova build ios --verbose',
  scriptLocation: '/Users/kshankar/Desktop/data/e-mission/native_code_upgrade/hooks/before_compile/ios/ios_change_deployment.js'
}

Apply patch to [
  'node_modules/@shopify/flash-list/ios/RNFlashList.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'node_modules/cordova-ios/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj',
  'node_modules/react-native/template/ios/HelloWorld.xcodeproj/project.pbxproj',
  'node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj/project.pbxproj',
  'node_modules/react-native-safe-area-context/ios/RNSafeAreaContext.xcodeproj/project.pbxproj',
  'node_modules/react-native-screens/ios/RNScreens.xcodeproj/project.pbxproj',
  'node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj/project.pbxproj',
  'platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
  'platforms/ios/Pods/Pods.xcodeproj/project.pbxproj',
  'platforms/ios/emission.xcodeproj/project.pbxproj'
]
Done setting IPHONEOS_DEPLOYMENT_TARGET
Executing script found in plugin cordova-custom-config for hook "before_compile": plugins/cordova-custom-config/hooks/applyCustomConfig.js
^[[32mcordova-custom-config: Loaded module dependencies^[[39m
^[[32mcordova-custom-config: Running applyCustomConfig.js^[[39m
^[[32mcordova-custom-config: Finished applying platform config^[[39m
before patching, grep -r IPHONEOS_DEPLOYMENT_TARGET platforms/ios | sort | uniq:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 10.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 8.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 9.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;

after patching, grep -r IPHONEOS_DEPLOYMENT_TARGET platforms/ios | sort | uniq:
 platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj:                         IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/Pods/Pods.xcodeproj/project.pbxproj:                              IPHONEOS_DEPLOYMENT_TARGET = 13.0;
platforms/ios/emission.xcodeproj/project.pbxproj:                               IPHONEOS_DEPLOYMENT_TARGET = 13.0;
```
@shankari shankari changed the base branch from master to maint_upgrade_2024 August 27, 2024 21:58
@shankari shankari merged commit ae46281 into e-mission:maint_upgrade_2024 Aug 27, 2024
9 checks passed
@shankari shankari deleted the upgrade_android_14 branch August 28, 2024 22:52
idillon-sfl pushed a commit to FabmobQC/mamobilite that referenced this pull request Sep 4, 2024
This ensures that we don't "discover" the plugin and try to install it
e-mission#1168 (comment)

Without this change:
```
Discovered plugin "cordova-plugin-ibeacon". Adding it to the project
Plugin "com.unarin.cordova.beacon" already installed on android.
Plugin "com.unarin.cordova.beacon" already installed on ios.
```

With this change: those logs don't show up
idillon-sfl pushed a commit to FabmobQC/mamobilite that referenced this pull request Sep 4, 2024
It was in `before_build` earlier, but that led to the changes from the script
being overridden before the actual compile started
e-mission/e-mission-docs#1079 (comment)
e-mission#1168 (comment)
e-mission#1168 (comment)
e-mission#1168 (comment)
e-mission#1168 (comment)

Testing done:

Before this change:

```
Done setting IPHONEOS_DEPLOYMENT_TARGET
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
```

After this change:

```
Overwriting existing resource file at platforms/ios/emission/Resources/GoogleService-Info.plist
^[[37mcordova-custom-config: Applied custom config from config.xml to /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/emission/emission-Info.plist^[[39m
...
Done setting IPHONEOS_DEPLOYMENT_TARGET
...
Touch /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/emission.app (in target 'emission' from project 'emission')
    cd /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios
    /usr/bin/touch -c /Users/kshankar/Desktop/data/e-mission/native_code_upgrade/platforms/ios/build/Debug-iphonesimulator/emission.app

** BUILD SUCCEEDED **
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⬆️ Upgrade the native code the latest versions
1 participant